<template>
  <div class="container">
    <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-bottom:10px;padding-top:10px;">
      <el-breadcrumb-item :to="{ path: '/job' }">求职页面</el-breadcrumb-item>
      <el-breadcrumb-item>公司详情</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="content">
      <div class="leftContent">
        <el-card style="margin-bottom: 20px;">
          <div class="header">
            关于我们
          </div>
          <div class="description">
            {{detail.description}}
          </div>
        </el-card>
        <el-card>
          <div class="header">
            在招岗位
          </div>
          <job-list :companyId="this.$route.params.companyId"></job-list>
        </el-card>
      </div>
      <el-card class="rightContent">
        <img :src="detail.avatarUrl" alt="">
        <div class="companyName">{{detail.name}}</div>
        <div>{{detail.industry}}</div>
        <div>{{detail.site}}</div>
      </el-card>
    </div>
  </div>
</template>

<script>
import JobList from '../components/JobList.vue'
export default {
  data () {
    return {
      detail: {}
    }
  },
  methods: {
    async getDetail () {
      const {companyId} = this.$route.params
      const res = await this.$http.get(`/job/company/${companyId}`)
      this.detail = res.data
    }
  },
  components: { JobList },
  created () {
    this.getDetail()
  }
}
</script>

<style scoped lang="less">
.description {
  text-indent: 2em;
  line-height: 20px;
}
.header {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 16px;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
}
.header::after {
  background: #5a9cf8;
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  top: 20px;
  width: 32px;
}
.container {
  padding: 0 100px;
  .content {
    display: flex;
    .leftContent {
      flex: 1;
      margin-right: 20px;
    }
    .rightContent {
      img {
        width: 180px;
        height: 150px;
      }
    }
  }
}

</style>
